package com.codingapi.websocket.core.handler;

import com.codingapi.websocket.core.client.WebSocketSession;
import io.netty.handler.codec.http.websocketx.WebSocketFrame;

/**
 * @author modificial
 * @date 2018/7/19
 * @company codingApi
 * @description 抽象扩展，自定义可以继承此类
 */
public abstract class AbstractWebSocketHandler implements WebSocketHandler {
    @Override
    public void beforeConnectionUpgraded(WebSocketSession webSocketSession) throws Exception {

    }

    @Override
    public void afterConnectionEstablished(WebSocketSession webSocketSession) throws Exception {

    }

    @Override
    public void handleMessage(WebSocketSession webSocketSession, WebSocketFrame webSocketFrame) throws Exception {

    }

    @Override
    public void handleTransportError(WebSocketSession webSocketSession, Throwable throwable) throws Exception {

    }

    @Override
    public void afterConnectionClosed(WebSocketSession webSocketSession) throws Exception {

    }

    @Override
    public boolean supportsPartialMessages() {
        return false;
    }
}
